home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / cclib / include / stat.h < prev    next >
C/C++ Source or Header  |  1995-11-16  |  1KB  |  65 lines

  1. #ifndef STAT_H
  2. #define STAT_H 1
  3.  
  4. #ifndef STDDEF_H
  5. #include "stddef.h"
  6. #endif
  7.  
  8.  
  9. /* this structure is filled in by the stat function */
  10.  
  11. struct stat
  12. {
  13. unsigned short st_attr; /* attribute, see below      */
  14. time_t st_mtime;    /* time of last modification */
  15. long st_size;        /* size in bytes         */
  16.  
  17. /* THESE ARE ONLY FILLED OUT BY THE stat_() FUNCTION
  18.  * in order to maintain compatibility with the older
  19.  * versions of CClib.library                 */
  20.  
  21. unsigned short st_mode; /* file type, see below      */
  22. short st_nlink;     /* number of links to file   */
  23. time_t st_atime;    /* time last accessed         */
  24. time_t st_ctime;    /* creation time         */
  25. };
  26.  
  27. /* st_mtime member is in seconds since Jan 1, 1978 */
  28.  
  29. /* st_attr member... */
  30.  
  31. /* file is NOT deletable */
  32. #define ST_DELETE (1L<<0)
  33. /* file is NOT executable */
  34. #define ST_EXECUTE (1L<<1)
  35. /* file is NOT writeable */
  36. #define ST_WRITE (1L<<2)
  37. /* file is NOT readable */
  38. #define ST_READ (1L<<3)
  39. /* file has been archived */
  40. #define ST_ARCHIVE (1L<<4)
  41.  
  42. /* bits for st_mode... */
  43.  
  44.  /* all file type bits */
  45. #define S_IFMT    0x16
  46.  /* directory */
  47. #define S_IFDIR 0x04
  48.  /* character special */
  49. #define S_IFCHR 0x02
  50.  /* block special */
  51. #define S_IFBLK 0x06
  52.  /* regular */
  53. #define S_IFREG 0x10
  54.  
  55. #ifdef ANSIC
  56. long stat(char *,struct stat *);
  57. long stat_(char *,struct stat *);
  58. #else
  59. long stat();
  60. long stat_();
  61. #endif
  62.  
  63. #endif
  64.  
  65.